# 将上一层的 #mt_gen 改成 #mt_gen_last
kill @e[tag=mt_gen_last]
tag @e[tag=mt_gen] add mt_gen_last
tag @e[tag=mt_gen] remove mt_gen

# 随机调用 clone / gen

# tellraw @a ["[雪山生成器]: 上一轮生成已完成，请选择下一轮模式\n", {"text": "[fork]","color": "gold", "clickEvent": {"action": "run_command","value": "/function mountain:gen/fork/entry"}}," ",{"text": "[clone]","color": "gold", "clickEvent": {"action": "run_command","value": "/function mountain:gen/clone/entry"}}," ",{"text": "[clear]","color": "gold", "clickEvent": {"action": "run_command","value": "/function mountain:gen/clear"}}]

# function mountain:gen/common/rnd/random
execute if score cur mt_layer matches 0 run tellraw @a ["[雪山生成器]: 山峰生成完成，请选择下一轮模式：\n", {"text": "[分叉]","color": "gold", "clickEvent": {"action": "run_command","value": "/function mountain:gen/fork/entry"}},"(前2轮推荐分叉)\n",{"text": "[延伸]\n","color": "gray", "clickEvent": {"action": "run_command","value": "/function mountain:gen/clone/entry"}},{"text": "[随机]\n","color": "gray", "clickEvent": {"action": "run_command","value": "/function mountain:gen/random_next/entry"}},{"text": "[清除]","color": "blue", "clickEvent": {"action": "run_command","value": "/function mountain:gen/clear"}}]
execute if score cur mt_layer matches 1 run tellraw @a ["[雪山生成器]: 第",{"score": {"name": "cur","objective": "mt_layer"}},"生成完成，请选择下一轮模式\n", {"text": "[分叉]","color": "gold", "clickEvent": {"action": "run_command","value": "/function mountain:gen/fork/entry"}},"(前2轮推荐分叉)\n",{"text": "[延伸]\n","color": "gray", "clickEvent": {"action": "run_command","value": "/function mountain:gen/clone/entry"}},{"text": "[随机]\n","color": "gray", "clickEvent": {"action": "run_command","value": "/function mountain:gen/random_next/entry"}},{"text": "[清除]","color": "blue", "clickEvent": {"action": "run_command","value": "/function mountain:gen/clear"}}]
execute if score cur mt_layer matches 2.. run tellraw @a ["[雪山生成器]: 第",{"score": {"name": "cur","objective": "mt_layer"}},"生成完成，请选择下一轮模式\n", {"text": "[分叉]","color": "gold", "clickEvent": {"action": "run_command","value": "/function mountain:gen/fork/entry"}},"(注意标志点会指数增长)\n",{"text": "[延伸]\n","color": "gold", "clickEvent": {"action": "run_command","value": "/function mountain:gen/clone/entry"}},{"text": "[随机]\n","color": "gold", "clickEvent": {"action": "run_command","value": "/function mountain:gen/random_next/entry"}},{"text": "[清除]","color": "blue", "clickEvent": {"action": "run_command","value": "/function mountain:gen/clear"}}]

scoreboard players add cur mt_layer 1